<template>
<div class="main">
  <div>{{all_myrest_ShareInfoShow==null?'':''}}</div>
  <div class="shareTit"><h3>{{all_myrest_ShareInfoShow==null?'':(all_myrest_ShareInfoShow.shareinfo.shareTitle)}}</h3></div>
  <div class="shareCnt">{{all_myrest_ShareInfoShow==null?'':(all_myrest_ShareInfoShow.shareinfo.shareContent)}}</div>
  <div class="shareImg">
    <div class="imgList" v-for="imgitem in imglist"><img v-bind:src="imgitem" /> </div>
  </div>
</div>
</template>
<script>
  import stores from './mystore.js'
  import Vue from 'vue';
  import { XButton, XInput,Group, Tab, TabItem } from 'vux'
  import { mapGetters,mapActions } from 'vuex'
  import sha1 from 'js-sha1'

  export default {
      data(){
          return {
              imglist:[],
              mypayload:{
              },
              buypayload:{
              },

              QueryUserPayload:{
                  url:'baseapi',
                  actionName:"QueryUserInfo",
                  postData: {
                      //mobile:"18616717008",
                      //password:"112233",
                      //treeView:"true"
                }
              },

              shareDetailsPayload:{
                  url:'duodata',
                  actionName:"ShareInfoShow",
                  postData:{
                      shareinfoId:""
                      //mobile:"18616717008",
                      //password:"112233",
                      //treeView:"true"
                  }
              },

          }
      },

      computed:{
/*
          all_myrest_IndexProducts(){
              var dataval=this.$store.getters.all_restful_IndexProducts;
              var testData={"myname":"dongguang"}
              if(dataval){
                  return dataval.body.indexproducts
              }else{
                  return null
              }
              //return dataval;
          },
          all_nots(){
              return this.$store.getters.all_nots
          },
          ...mapGetters([ 'evenOrOdd'
          ])
          */
//all_restful_ShareInfoShow
          all_myrest_QueryUserInfo(){
              var dataval=this.$store.getters.all_restful_QueryUserInfo;
              if(dataval){
                  return dataval
              }else{
                  return null
              }
              //return dataval;
          },
          all_myrest_ShareInfoShow(){
              var dataval=this.$store.getters.all_restful_ShareInfoShow;
              if(dataval){
                  this.imglist=dataval.body.shareinfo.shareimageList
                  return dataval.body
              }else{
                  return null
              }
              //return dataval;
          },
          all_myrest(){
              return this.$store.getters.all_logindata
          },

      },
      created (){
          // this.cntReady();
          this.shareDetails();
          //console.log('hahahahhahahahah'+this.cntReady())
      },

      methods:{
          doesh (){
            this.$store.commit('restful_api',this.QueryUserPayload)
          },

          GetQueryString:function(name){
              var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
              var r = document.URL.split("?")[1].match(reg);
              //alert("ddd:"+window.location.search)
              if(r!=null)return  unescape(r[2]); return null;
          },

          shareDetails:function(){
            var shareId=this.GetQueryString("shareInfoId")
            this.shareDetailsPayload.postData.shareinfoId=shareId;
            this.$store.commit('restful_api',this.shareDetailsPayload)
          },
        /*  cntReady(){
              console.info(3434343);
              this.$store.commit('restful_api',this.mypayload);
           },
          ...mapActions([
              'increment',
              'decrement',
              'incrementIfOdd'
          ]),
        */
      },
      components: { XButton, Group, XInput, Tab, TabItem }

  }

</script>

<style scoped>
    *{ margin:0; padding:0;}
    html{ background-color:#fbfbfb;}
    body,html,main{ width:100%; font-size:12px;}
    div img{ width:100%;}
  .shareImg,.shareTit,.shareCnt{ padding: 10px;}


</style>
